package com.iteaj.network.test;

import com.iteaj.network.config.ConnectProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "iot.test")
public class IotTestProperties {

    /**
     * 启用客户端测试
     */
    private boolean client;

    /**
     * 启用服务端测试
     */
    private boolean server;

    /**
     * 基于换行符解码组件测试
     */
    private TestConfig line;

    /**
     * 服务端主机地址
     */
    private String serverHost;

    public boolean isClient() {
        return client;
    }

    public void setClient(boolean client) {
        this.client = client;
    }

    public boolean isServer() {
        return server;
    }

    public void setServer(boolean server) {
        this.server = server;
    }

    public TestConfig getLine() {
        return line;
    }

    public void setLine(TestConfig line) {
        this.line = line;
    }

    public String getServerHost() {
        return serverHost;
    }

    public void setServerHost(String serverHost) {
        this.serverHost = serverHost;
    }

    public static class TestConfig extends ConnectProperties {

        public TestConfig() { }

        public TestConfig(Integer port) {
            super(port);
        }

        public TestConfig(String host, Integer port) {
            super(host, port);
        }

        /**
         * 测试的客户端数量(默认1000)
         */
        private int clientNum = 1000;

        public int getClientNum() {
            return clientNum;
        }

        public void setClientNum(int clientNum) {
            this.clientNum = clientNum;
        }
    }
}
